<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>${SYSTEM_NAME}</title>
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css" media="all">
</head>
<body class="layui-layout-body">
	<div class="layui-fluid" style="background-color: #fff;">
		<form class="layui-form" action="" style="width:100%" name="basicform">
		  <input type="text" name="id" style="display: none;" value="${paramHoliday.id }"/>
		  <input type="text" name="holidayYear" style="display: none;" value="${paramHoliday.holidayYear }"/>
		  <input type="text" name="holidayMonth" style="display: none;" value="${paramHoliday.holidayMonth }"/>
		  <input type="text" name="holidayDay" style="display: none;" value="${paramHoliday.holidayDay }"/>
		  <input type="text" name="holidayDate" style="display: none;" value="${paramHoliday.holidayDate }"/>
		  <div class="layui-form-item">
		    <label class="layui-form-label layui-form-required">假日类型</label>
		    <div class="layui-input-inline">
		      <select id="holidayType" name="holidayType">
				  <c:forEach items="${holidayTypeMap}" var="t">
					  <option value="${t.key }" <c:if test="${t.key eq paramHoliday.holidayType}">selected="selected"</c:if>>${t.value }</option>
				  </c:forEach>
		        </select>
		    </div>
		  </div>
		  
		  <div class="layui-form-item">
		    <label class="layui-form-label">备注</label>
		    <div class="layui-input-inline">
		      <input type="text" name="remark" 
		      placeholder="请输入备注" class="layui-input" value="${paramHoliday.remark}">
		    </div>
		  </div>
		  
		  <div class="layui-form-item">
		    <div class="layui-input-block">
		      <button class="layui-btn" lay-submit="" lay-filter="sub">确定</button>
		      <button type="button" class="layui-btn layui-btn-normal" onclick="closed()">关闭</button>
		    </div>
		  </div>
		</form>
  	</div>
<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
<script>
	layui.config({
		base: getContextPath() + '/static/layuiadmin/' //静态资源所在路径
	}).extend({
		index: 'lib/index' //主入口模块
	}).use(['form'], function() {
		var form = layui.form;
	
	form.on('submit(sub)', function(data){
		$ajax({
			url: "/sys/paramHoliday/add/save",
			data: data.field,
	        succCallback: function (json) {
				if(json.code == 0){
            		parent.addReload($("#holidayType").find("option:selected").text());
            		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
            		parent.layer.close(index);//关闭弹出的子页面窗口
            		parent.layer.msg(json.msg);
            	}
	        }
		});
		return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
	});
	
});

function closed(){
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
	parent.layer.close(index);//关闭弹出的子页面窗口
}


</script>
</body>
</html>